home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 June: Reference Library / Dev.CD Jun 00 RL Disk 1.toast / pc / technical documentation / develop / develop issue 26 / develop issue 26 code / mpw tips and tricks - pascaltoc / c.pascal scripts / ctopascal next >
Encoding:
Text File  |  1990-08-20  |  1.1 KB  |  45 lines

  1. set plainInt integer    # use longint with MPW C
  2.  
  3. set exit 0
  4. for f in {"parameters"}
  5.     target "{f}"
  6.     subword void procedure
  7.     subword "short int" integer
  8.     subword "long int" longint
  9.     subword short integer
  10.     subword long longint
  11.     subword int {plainInt}
  12.     substitute '->' '^.'
  13.     substitute '∂*([a-zA-Z_0-9]+)®1' '®1^'
  14.     substitute '==' '¥EQUALS¥'
  15.     substitute '!=' '¥NOTEQUAL¥'
  16.     substitute '>=' '¥GREATEREQUAL¥'
  17.     substitute '<=' '¥LESSEQUAL¥'
  18.     substitute '=' '¥ASSIGN¥'
  19.     substitute '¥EQUALS¥' '='
  20.     substitute '¥NOTEQUAL¥' '<>'
  21.     substitute '¥GREATEREQUAL¥' '>='
  22.     substitute '¥LESSEQUAL¥' '<='
  23.     substitute '¥ASSIGN¥' '∂:='
  24.     find •
  25.     replace -c ∞ '/[¬a-zA-Z_0-9]if∂ *∂((≈)®1∂)/' 'if ®1 then'
  26.     find •
  27.     replace -c ∞ '/[¬a-zA-Z_0-9]while∂ *∂((≈)®1∂)/' 'while ®1 do'
  28.     find •
  29.     replace -c ∞ '/[¬a-zA-Z_0-9]case∂ *(≈)®1∂:/' '®1: begin '
  30.     find •
  31.     replace -c ∞ '/[¬a-zA-Z_0-9]switch∂ *∂((≈)®1∂)∂ *∂{/' 'case ®1 of'
  32.     subword register ''
  33.     subword return 'return :='
  34.     subword struct record
  35.     subword typedef ''
  36.     subword variant union
  37.     substitute '{' begin
  38.     substitute '}' "end∂;"
  39.     substitute '∂/∂*' '∂(∂*'
  40.     substitute '∂*∂/' '∂*∂)'
  41.     #save "{target}"
  42.     #close "{target}"
  43. end
  44. set exit 1
  45.